# -*- coding: utf-8 -*-
# time: 2025/8/9 16:16
# file: urls.py
# author: kai
# email: 1071664616@qq.com

"""
健康相关urls
"""
from django.urls import path

from . import views

urlpatterns = [
    # BodyRecord URLs
    path('body-records/', views.BodyRecordListCreateView.as_view(), name='body-record-list'),
    path('body-records/<int:pk>/', views.BodyRecordDetailView.as_view(), name='body-record-detail'),
    path('my-body-records/', views.my_body_records, name='my-body-records'),

    # Comment URLs
    path('comments/', views.CommentListCreateView.as_view(), name='comment-list'),
    path('comments/<int:pk>/', views.CommentDetailView.as_view(), name='comment-detail'),

    # EatingRecord URLs
    path('eating-records/', views.EatingRecordListCreateView.as_view(), name='eating-record-list'),
    path('eating-records/<int:pk>/', views.EatingRecordDetailView.as_view(), name='eating-record-detail'),
    path('my-eating-records/', views.my_eating_records, name='my-eating-records'),

    # Notice URLs
    path('notices/', views.NoticeListCreateView.as_view(), name='notice-list'),
    path('notices/<int:pk>/', views.NoticeDetailView.as_view(), name='notice-detail'),

    # SleepRecord URLs
    path('sleep-records/', views.SleepRecordListCreateView.as_view(), name='sleep-record-list'),
    path('sleep-records/<int:pk>/', views.SleepRecordDetailView.as_view(), name='sleep-record-detail'),
    path('my-sleep-records/', views.my_sleep_records, name='my-sleep-records'),

    # SportsRecord URLs
    path('sports-records/', views.SportsRecordListCreateView.as_view(), name='sports-record-list'),
    path('sports-records/<int:pk>/', views.SportsRecordDetailView.as_view(), name='sports-record-detail'),
    path('my-sports-records/', views.my_sports_records, name='my-sports-records'),

    # crontab URLs
    path('scheduled-tasks/', views.ScheduledTaskListView.as_view(), name="scheduled-task-list"),
    path('scheduled-tasks/<int:pk>/', views.ScheduledTaskDetailView.as_view(), name="scheduled-task-detail"),
    path('scheduled-tasks/<int:pk>/execute/', views.ScheduledTaskExecuteView.as_view(), name="scheduled-task-execute"),

    # health news URLs
    path('health-news/', views.HealthNewsListView.as_view(), name='health-news-list'),

    # SensitiveWord URLs
    path('sensitive-words/', views.SensitiveWordListCreateView.as_view(), name='sensitive-word-list'),
    path('sensitive-words/<int:pk>/', views.SensitiveWordDetailView.as_view(), name='sensitive-word-detail'),
    path('sensitive-words/categories/', views.sensitive_word_categories, name='sensitive-word-categories'),

    # post URLs
    path('posts/', views.PostListCreateView.as_view(), name='post-list'),
    path('posts/<int:pk>/', views.PostDetailView.as_view(), name='post-detail'),
    path('public-posts/', views.PublicPostListView.as_view(), name='public-post-list'),
    
    # 帖子收藏 URLs
    path('posts/<int:post_id>/favorite/', views.PostFavoriteCreateView.as_view(), name='post-favorite-create'),
    path('posts/<int:post_id>/unfavorite/', views.PostFavoriteDeleteView.as_view(), name='post-favorite-delete'),
    path('favorites/', views.PostFavoriteListView.as_view(), name='post-favorite-list'),
    
    # 帖子点赞 URLs
    path('posts/<int:post_id>/like/', views.PostLikeCreateView.as_view(), name='post-like-create'),
    path('posts/<int:post_id>/unlike/', views.PostLikeDeleteView.as_view(), name='post-like-delete'),
    
    # 帖子状态 URLs
    path('posts/<int:post_id>/status/', views.post_user_status, name='post-user-status'),
    path('posts/<int:post_id>/stats/', views.post_stats, name='post-stats'),
    
    # 文件上传URL
    path('upload/image/', views.ImageUploadView.as_view(), name='image-upload'),
    
    # 用户健康数据统计URL
    path('user/stats/', views.user_health_stats, name='user-health-stats'),
    
    # 管理员仪表板统计URL
    path('admin/stats/', views.admin_dashboard_stats, name='admin-dashboard-stats'),
    
    # 体检报告 URLs
    path('health-reports/', views.HealthReportListCreateView.as_view(), name='health-report-list'),
    path('health-reports/<int:pk>/', views.HealthReportDetailView.as_view(), name='health-report-detail'),
    path('health-reports/<int:report_id>/analysis-stream/', views.health_report_analysis_stream, name='health-report-analysis-stream'),
    path('health-reports/<int:report_id>/trigger-analysis/', views.trigger_health_report_analysis, name='health-report-trigger-analysis'),
    
    # 用户健康分析 URLs
    path('user/yesterday-analysis/', views.user_yesterday_analysis, name='user-yesterday-analysis'),
]